Public Class HorarioForm
    Dim operacion_ As String
    Dim MiHorario As New HorarioClass

    Public Property operacion() As String
        Get
            Return operacion_
        End Get
        Set(ByVal value As String)
            operacion_ = value
        End Set
    End Property

    Dim indice_ As Byte
    Public Property indice() As Byte
        Get
            Return indice_
        End Get
        Set(ByVal value As Byte)
            indice_ = value
        End Set
    End Property

    Private Sub Aceptar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Aceptar.Click

        MiHorario.idcarrera = ComboBox1.SelectedIndex
        MiHorario.idasignatura = ComboBox2.SelectedIndex
        MiHorario.Idmodulo = ComboBox3.SelectedIndex

        Select Case operacion_
            Case "Alta"
                'horarios_list.Add(MiHorario)
                horarios_list.InsertarHorario(MiHorario)

            Case "Elimina"
                'horarios_list.RemoveAt(indice_)
                horarios_list.EliminarHorario(indice_)

            Case "Modifica"
                'horarios_list.Item(indice_) = MiHorario
                horarios_list.ActualizarHorario(MiHorario, indice_)

                HorariosGrid.DataGridView1.Refresh()
        End Select

        Me.Close()
    End Sub

    Private Sub Cancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancelar.Click
        Me.Close()
    End Sub

End Class
